//
//  UIView+Extension.h
//  01-黑酷
//
//  Created by apple on 14-6-27.
//  Copyright (c) 2014年 heima. All rights reserved.
//

#import <UIKit/UIKit.h>


@interface UIView (Extension)
@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat rightX;
@property (nonatomic, assign) CGFloat y;
@property (nonatomic, assign) CGFloat bottomY;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@property (nonatomic, assign) CGSize size;
@property (nonatomic, assign) CGPoint origin;
@property (nonatomic, assign) CGFloat centerX;
@property (nonatomic, assign) CGFloat centerY;


/**
 *  9.上 < Shortcut for frame.origin.y
 */
@property (nonatomic) CGFloat top;

/**
 *  10.下 < Shortcut for frame.origin.y + frame.size.height
 */
@property (nonatomic) CGFloat bottom;


+ (CGFloat)sc_statusBarHeight;

+ (CGFloat)sc_navigationBarHeighExcludeStatusBar;

+ (CGFloat)sc_navigationBarHeight;

+ (CGFloat)sc_bottomInset;


/**
 *  11.左 < Shortcut for frame.origin.x.
 */
@property (nonatomic) CGFloat left;

/**
 *  12.右 < Shortcut for frame.origin.x + frame.size.width
 */
@property (nonatomic) CGFloat right;

@property (class, nonatomic, readonly) CGFloat sc_statusBarHeight; // 37 for iPhone X, 20 for Others

@property (class, nonatomic, readonly) CGFloat sc_navigationBarHeighExcludeStatusBar; // 44

@property (class, nonatomic, readonly) CGFloat sc_navigationBarHeight; // status + naviExStatus

@property (class, nonatomic, readonly) CGFloat sc_bottomInset;

/**
 部分圆角

 @param radius 角度
 @param corners 圆角位置
 */
- (void)setRoundedRadius:(CGFloat)radius roundingCorners:(UIRectCorner)corners;
/**
 全部圆角

 @param radius 角度
 */
-(void)setRoundedRadius:(CGFloat)radius;


/**
 添加阴影

 @param radius <#radius description#>
 */
-(void)ShadowRadius:(CGFloat)radius;

/**
 添加阴影
 
 @param Color 颜色
 @param radius 阴影半径
 @param shadowOpacity 阴影透明度
 @param shadowOffset 阴影偏移量
 */
- (void)addShadowWithColor:(UIColor*)Color
                    radius:(CGFloat)radius
             shadowOpacity:(CGFloat)shadowOpacity
              shadowOffset:(CGSize)shadowOffset;

/**
 添加边框颜色和宽度

 @param Color 颜色
 @param width 宽度
 */
- (void)addBorderWithColor:(UIColor*)Color borderWidth:(CGFloat)width;


/**
 添加底部border

 @param color <#color description#>
 @param borderWidth <#borderWidth description#>
 */
-(void)addBottomBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth;



/**
 添加右边border

 @param color <#color description#>
 @param borderWidth <#borderWidth description#>
 */
-(void)addRightBorderWithColor: (UIColor *) color andWidth:(CGFloat) borderWidth;

/**
 添加点击事件

 @param target 相应对象
 @param action 绑定方法
 */

- (void)addTarget:(id)target action:(SEL)action;

/**
 获取当前视图的视图控制器

 @return 返回视图控制器
 */
- (UIViewController *)currentViewController;
+ (UIViewController *)currentVC;
/**
 画一条虚线
 
 @param lineView 线 view
 @param lineLength  线的长度
 @param lineSpacing 线的宽度
 @param lineColor 线的颜色
 */
+ (void)drawDashLine:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor;


@end
